package com.ostrich.lib_common.net;

import com.blankj.utilcode.util.SPUtils;

import java.io.IOException;

import javax.xml.parsers.SAXParser;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

/**
 * @Author : yaotianxue
 * @Time : On 2023/10/7 09:38
 * @Description : Tokeninterceptor
 */
public class TokenInterceptor implements Interceptor {
    @Override
    public Response intercept(Chain chain) throws IOException {
        String token = SPUtils.getInstance().getString("token");
        Request request = chain.request().newBuilder().addHeader("token", token).build();
        return chain.proceed(request);
    }
}
